# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sigar
pkgver=1.6.4
pkgrel=3
pkgdesc="System Information Gatherer And Reporter"
url="http://sigar.hyperic.com/"
# riscv64 blocked by java-jdk
# s390x: FTBFS due to SIGFPE in jvm
# ppc64le: hang during build
arch="all !riscv64 !s390x !ppc64le"
license="Apache-2.0"
makedepends="libtirpc-dev perl apache-ant java-jdk"
source="https://github.com/hyperic/sigar/archive/sigar-$pkgver.tar.gz
	0001-fix-compilation-with-musl-libc.patch
	0002-only-enable-the-GNU-libc-strerror_r-on-GNU-libc.patch
	0003-build-with-libtirpc-and-gcc5.patch
	0006-fix-undefined-symbols.patch
	0007-sigar-add-sysmacros.patch
	0008-change-language-level-to-18.patch
	0009-aarch64-no-m64.patch 
	"

builddir="$srcdir/sigar-sigar-$pkgver"

build() {
	cd bindings/java
	ant
}

package() {
	cd bindings/java
	install -Dm644 -t "$pkgdir"/usr/lib sigar-bin/lib/libsigar-*.so
}

sha512sums="
0515f3501a51357d6ac01dc5e3ecffae10995f347b98c66928adff247b86e52112d2bf9cf78b2633941eb9c7fb23f019f4885c41348fe461239e4eebd147253e  sigar-1.6.4.tar.gz
577f10add8dfe3f1e97375aba06fdecb4ae9d64d75246107cde2183a9efee5eeb8f2c00c072397e2ac4bba2dc49e67c5efef141c609f84a6128d03f3f5187d05  0001-fix-compilation-with-musl-libc.patch
12f68a3c3449b98a45458aa189a633d32ccc9adab83e04e84c8e496c1e0545a58ecc86fdcb68d55b162f5717244f69a48f0a13241b672c909993dc13643c8c64  0002-only-enable-the-GNU-libc-strerror_r-on-GNU-libc.patch
1896f8deb1945dd18283cb391528791b7554b2a4d56c0bc02a58d36a6af2a333782486a508e4d756b558d522d9a759bb3eefe12f0fd1720a9b83426d2b9bf469  0003-build-with-libtirpc-and-gcc5.patch
b85593c1b07c2c7ac3cd66df70e2ab75e615547c14c797c4e6ce0508fc3a02988e5c9055f0dada14bdf0cb060c35129872239f01e9cf0e0481d0038578f93908  0006-fix-undefined-symbols.patch
678fe505286ec31297d1459788f44144ecd7f35a35523f53be8cf8d699e45491a4573968ac8e8f88620acdae49e5aa2b130dc18c1c7c311b026b3ed1e65166fe  0007-sigar-add-sysmacros.patch
ad462ef488639d8ae5f1446f0c58123bfa3a6ede7b98c7e155f693d29b3460a6cc63933c4b124b4b232ca2ccc6c7d7bbcecbd4bf3eccda237f22429cafaa3665  0008-change-language-level-to-18.patch
ccd2f2864aca3c853e030b246cbb0fa38511187fdb0a01a482b36efedd41b18dfbcade3b9c48075110eaa5b911823679f7f330750eb52f0224a478c00be920d8  0009-aarch64-no-m64.patch
"
